feat: Support LDAP bind with template as well as the existing BIND_DN and credentials #10214
+818
−418
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The current LDAP config requires the
LDAP_BIND_DNandLDAP_BIND_CREDENTIALSto be setup, which means a new service account needs to be created. This shouldn't be necessary though, since we can have the same feature set by bind directly using the users provided credentials during login.This PR adds a new environment variable
LDAP_BIND_DN_TEMPLATEthat can be used to configure the required search to perform during binding to successfully authenticate and search for the user details. The environment variablesLDAP_BIND_DNandLDAP_BIND_CREDENTIALSmust not be set in order for the template method to run instead.For example:
LDAP_BIND_DN_TEMPLATE=uid={{username}},ou=users,dc=somedomain,dc=comChange Type
Please delete any irrelevant options.
Testing
Please describe your test process and include instructions so that we can reproduce your test. If there are any important variables for your testing configuration, list them here.
Test Configuration:
Checklist
Please delete any irrelevant options.